package com.newtouch.bxzs.business.message.controller;

import com.newtouch.bxzs.business.config.MyLog;
import com.newtouch.bxzs.business.message.model.AppHomeContentBO;
import com.newtouch.bxzs.business.message.service.AppHomeInitContentService;
import com.newtouch.bxzs.common.base.response.BaseResponse;
import com.newtouch.bxzs.common.base.response.RespGenerator;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * App首页Controller:
 *
 * <p>
 * <b>History:</b>
 * <table border="1">
 * <tr>
 * <th>Date</th>
 * <th>Operator</th>
 * <th>Memo</th>
 * </tr>
 * <tr>
 * <td>2021/1/21 9:30</td>
 * <td>tianshangzhu</td>
 * <td>Create</td>
 * </tr>
 * </table>
 *
 * @author tianshangzhu
 * @version 1.0.0
 * @since 1.0.0
 */
@RestController
@RequestMapping("/app/home")
@Api(tags = "app首页内容")
@SuppressWarnings("unchecked")
public class AppHomeController {
    private static final Logger logger = LoggerFactory.getLogger(AppHomeController.class);
    @Resource
    private AppHomeInitContentService appHomeInitContentService;

    @GetMapping("/init/content")
    @ApiOperation("首页展示内容")
    @MyLog(systemFunctionName = "app首页内容", systemFunctionUrl = "/app/home/init/content",
            userOperationType = 4, userOperationSummary = "查询app首页初始内容")
    public BaseResponse<AppHomeContentBO> getInitContent() {
        logger.info("查询app首页初始内容");
        return RespGenerator.returnOK(appHomeInitContentService.getAppHomeInitContent());

    }
}
